Communication apparatus and control method for communication apparatus

ABSTRACT

A communication apparatus capable of efficiently creating transmission packets even when a free space of a storage unit storing transmission packet headers is insufficient includes a first storage unit to store a header of a transmission packet when the transmission packet is created in a first processing procedure, a first creation unit to create the transmission packet in the first processing procedure using the first storage unit, a second storage unit to store the transmission packet header when the transmission packet is created in a second processing procedure, a second creation unit to create the transmission packet in the second processing procedure using the second storage unit, and a control unit to control which one of the first and second creation units is used based on a data size necessary for the first creation unit to create the header and a free space of the first storage unit.

BACKGROUND Field of the Disclosure

The present disclosure relates to a communication apparatus and acontrol method for the communication apparatus.

Description of the Related Art

In recent years, data traffic has been increasing along with increasingneeds for browsing high-resolution moving images (8K/4K resolutionimages) on multifunction terminals called smart devices, which have beenrapidly increasing, via a network. In addition, a load on a centralprocessing unit (CPU) due to communication protocol processing using,for example, Transport Control Protocol (TCP)/User Datagram Protocol(UDP)/Internet Protocol (IP), has been increasing along with animprovement in the speed of networks for, for example, 10 gigabit persecond (Gbps) communication by Ethernet® and 5th-Generation (5G)communication for a moving object communication. To achieve high-speeddata communication using a communication protocol such as TCP/UDP/IP, atechnique for reducing a communication protocol processing load on a CPUhas been proposed.

As a technique for reducing a communication protocol processing load ona CPU, there is a technique of reducing a load on a CPU by off-loading apart (TCP segment processing) of communication protocol processing to beexecuted by the CPU. The TCP segment processing is processing ofconverting transmission data created in an application layer, which isdefined by an Open Systems Interconnection (OSI) reference modeldesigned by the International Organization for Standardization (ISO),into transmission packets to be used in a communication layer which is alower layer.

As an example of the TCP segment processing, a transmission packetcreation method is discussed in United States Patent PublicationApplication No. 2007/0223472. In United States Patent PublicationApplication No. 2007/0223472, a payload dividing unit dividestransmission data which is created in an application layer and has alength exceeding a transferable length into pieces of data each having atransferable length, thereby creating a plurality of transmissionpayloads. Then, a header duplicating unit creates (duplicates) as manyheaders as the number of transmission payloads so that the headers aregiven to the respective transmission payloads. After that, a packetgenerating unit generates a plurality of transmission packets bycombining the created headers with the transmission payloads.

In United States Patent Publication Application No. 2007/0223472, theheader duplicating unit creates a plurality of headers respectivelycorresponding to the transmission payloads and stores the createdheaders in a header buffer. However, the free space of the header buffermay be insufficient to store all the headers. In such a case, creatingtransmission packets after waiting for release of the header bufferleads to an increase in processing time required for creatingtransmission packets and to a deterioration in communicationperformance.

Accordingly, there is a need for a communication apparatus capable ofefficiently creating transmission packets even when the free space of astorage unit for storing headers of transmission packets isinsufficient.

SUMMARY

According to an aspect of the present disclosure, a communicationapparatus includes a first storage unit configured to store a header ofa transmission packet when the transmission packet is created in a firstprocessing procedure, a first creation unit configured to create thetransmission packet in the first processing procedure using the firststorage unit, a second storage unit configured to store the header ofthe transmission packet when the transmission packet is created in asecond processing procedure different from the first processingprocedure, a second creation unit configured to create the transmissionpacket in the second processing procedure using the second storage unit,and a control unit configured to perform control to determine which oneof the first creation unit and the second creation unit is used based ona data size necessary for the first creation unit to create the headerand a free space of the first storage unit.

Further features of the present disclosure will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an example of a moduleconfiguration (hardware configuration) of a communication apparatus.

FIG. 2 is a block diagram illustrating an example of a configuration ofa communication apparatus according to one or more aspects of thepresent disclosure.

FIG. 3 is a flowchart illustrating a procedure for switchingtransmission packet creation units according to one or more aspects ofthe present disclosure.

FIG. 4 is a block diagram illustrating an example of a configuration ofa communication apparatus according to one or more aspects of thepresent disclosure.

FIG. 5 is a flowchart illustrating a procedure for switchingtransmission packet creation units according to one or more aspects ofthe present disclosure.

FIG. 6 is a block diagram illustrating an example of a configuration ofa communication apparatus according to one or more aspects of thepresent disclosure.

FIG. 7 is a flowchart illustrating a procedure for switchingtransmission packet creation units according to one or more aspects ofthe present disclosure.

FIG. 8 is a flowchart illustrating a procedure for switchingtransmission packet creation units according to one or more aspects ofthe present disclosure.

FIG. 9 is a flowchart illustrating a procedure for switchingtransmission packet creation units according to one or more aspects ofthe present disclosure.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments for carrying out the present disclosure will bedescribed in detail below with reference to the accompanying drawings.The exemplary embodiments described below are examples for implementingthe present disclosure and should be modified or changed, as needed,depending on the configuration of an apparatus or system to which thepresent disclosure is applied, or depending on various conditions. Thepresent disclosure is not limited to the exemplary embodiments describedbelow.

(Configuration of Apparatus)

FIG. 1 is a block diagram illustrating a module configuration example ofa communication apparatus 100 according to a first exemplary embodiment.The communication apparatus 100 need not necessarily include all themodules described below, and may include modules other than the modulesdescribed below.

The communication apparatus 100 includes a main central processing unit(CPU) 101, a main memory 102, and a sub-system 103. The sub-system 103executes communication protocol processing. The modules 101 to 103 inthe communication apparatus 100 are connected to each other via a systembus 104.

The main CPU 101 executes application software in an application layerdefined by an Open Systems Interconnection (OSI) reference model.Further, the main CPU 101 controls the entire communication apparatus100. Data and programs required for the main CPU 101 to execute theapplication software are stored in the main memory 102. The main CPU 101loads data and programs, as needed, from the main memory 102 via thesystem bus 104, or writes data and programs into the main memory 102.The main CPU 101 may be configured using a processor such as aMicro-Processing Unit (MPU). The main CPU 101 may include a plurality ofprocessors such as a multi-core processor.

The main memory 102 is a memory that can be shared among the modules 101to 103 in the communication apparatus 100, and includes a semiconductormemory such as a dynamic random access memory (DRAM). An internal areaof the main memory 102 is divided into an area for storing programs, anapplication buffer area used by the application software, and otherareas.

The sub-system 103 includes, as main functional blocks, a sub-CPU 106, alocal memory 107, a Direct Memory Access (DMA) controller 108, acommunication interface 109, and a header processing unit 110. Thefunctional blocks 106 to 110 in the sub-system 103 are connected to eachother via a local bus 105. The communication interface 109 is connectedto a network 111. The header processing unit 110 includes, as mainfunctional blocks, a register unit 112, an internal memory 113, and acore unit 114. The network 111 may be a wired network or a wirelessnetwork.

The sub-system 103 executes communication protocol processing in thecommunication apparatus 100 as described above. The sub-system 103specializes in communication protocol processing using, for example,Transport Control Protocol (TCP)/Internet Protocol (IP), and performsdata transfer processing with an external device (another communicationapparatus) via the network 111. Further, the sub-system 103 is equippedwith hardware dedicated to communication protocol processing, andexecutes high-speed communication protocol processing on behalf of themain CPU 101. The communication protocols processed by the sub-system103 may be communication protocols other than TCP/IP.

The sub-CPU 106 executes communication protocol processing.Specifically, the sub-CPU 106 performs communication protocol processing(transmission sequence control, congestion control, communication errorcontrol, etc.) of Internet Protocol version 4 (IPv4), Internet Protocolversion 6 (IPv6), User Datagram. Protocol (UDP), and TCP. The sub-CPU106 may be configured using one processor, or may be configured using aplurality of processors (multi-processor configuration). The sub-CPU 106may also be configured using hardware for accelerating processors andsome functions.

The local memory 107 is a memory that can be used by the sub-CPU 106,and includes a semiconductor memory such as a static random accessmemory (SRAM). The local memory 107 is also accessible from the main CPU101 via the system bus 104 and the local bus 105.

The DMA controller 108 executes DMA transfer according to an instructionfrom the sub-CPU 106. The DMA transfer is executed according to contentsdescribed in a descriptor. The descriptor is a description ofinformation, such as address information about a data transfer source,address information about a data transfer destination, and a transfersize of data transfer. The sub-CPU 106 writes the descriptor into thelocal memory 107, and then notifies the DMA controller 108 of a DMA,transfer start instruction. As a method for notifying the DMA transferstart instruction, for example, address information about the localmemory 107 storing the descriptor may be set. The DMA controller 108which has received the notification about the DMA transfer startinstruction can execute DMA transfer between the main memory 102 and thelocal memory 107 and DMA transfer between the internal memory 113 andthe local memory 107 based on the contents of the instruction. The DMAcontroller 108 can also execute DMA transfer between the internal memory113 and the communication interface 109 and DMA transfer between thelocal memory 107 and the communication interface 109 based on thecontents of the DMA transfer start instruction.

The communication interface 109 is an interface with the network 111,such as a local area network (LAN), and performs communication controlfor a physical layer (PHY layer) and a data link layer (MAC layer) inthe communication. The communication interface 109 includes a buffermemory for temporarily storing transmission/reception informationtherein. The transmission/reception information is input and output byDMA transfer of the DMA controller 108. The communication interface 109may incorporate a DMA controller such that the transmission/receptioninformation is input and output by DMA transmission using the DMAcontroller. A plurality of communication interfaces 109 may be provided.For example, when the network 111 is a wired network, a communicationinterface suitable for the wired network is used. When the network 111is a wireless network, a communication interface suitable for thewireless network is used.

In the present exemplary embodiment, the header processing unit 110executes communication header creation processing in the communicationprotocol processing on behalf of the sub-CPU 106. The header processingunit 110 may be configured as, for example, hardware for acceleratingheader processing.

The register unit 112 stores header information 115 (hereinafterreferred to as the “template header 115”) as a template for headerprocessing, header edit information 116 necessary for creating acommunication header, control information 117 necessary for controllingthe core unit 114, and the like.

The template header 115 is header information which is duplicated by theheader processing unit 110 and serves as a basis for creating aplurality of communication headers 118. The sub-CPU 106 creates thetemplate header 115 by software processing. The configuration of thetemplate header 115 is divided into, for example, a TCP header in atransport layer and an IP header in a network layer, which are definedby the OSI reference model. The TCP header and the IP header are usedwhen communication protocol processing in each layer is executed. Thetemplate header 115 may include not only the TCP header and the IPheader, but also an Ether header. The Ether header is a communicationheader used in a data link layer defined by the OSI reference model inwhich a MAC address of a transmission destination and a MAC address of atransmission source are described. Further, in the template header 115,a UDP header may be used instead of the TCP header.

The header edit information 116 is edit information necessary forcreating the communication headers 118. The sub-CPU 106 sets the headeredit information 116 by software processing. The header edit information116 contains the number of times of duplication of the template header115, the type of each communication header 118 to be created, an editportion in each communication header 118 created by duplicating thetemplate header 115, an editing method, and other information.

The control information 117 is information necessary for controlling thecore unit 114. The sub-CPU 106 sets the control information 117 bysoftware processing.

The internal memory 113 is a memory that can be used by the core unit114 of the header processing unit 110 and the sub-CPU 106, and includesa semiconductor memory such as a static random access memory (SRAM). Theinternal memory 113 stores the communication headers 118 created by thecore unit 114. The internal memory 113 has a free space 119.

The core unit 114 is a module that executes header processing and iscontrolled based on the control information 117 stored in the registerunit 112. When the core unit 114 starts header processing according tothe control information 117 stored in the register unit 112, the coreunit 114 duplicates a designated number of template headers 115 as thecommunication headers 118 in the internal memory 113 according to theheader edit information 116 stored in the register unit 112. Further,the core unit 114 edits information in the headers of the communicationheaders 118 according to the header edit information 116, and thencompletes the creation of the communication headers 118.

(Software Configuration)

FIG. 2 is a block diagram illustrating a software configuration of thecommunication apparatus 100 according to the present exemplaryembodiment.

The communication apparatus 100 includes a control unit 201, a LANcommunication control unit 202, a storage control unit 203, a TCP/IPcommunication control unit 204, a first packet creation unit 205, asecond packet creation unit 206, and a first memory free spacemanagement unit 207. The TCP/IP communication control unit 204 ishereinafter referred to as the “TCP/IP control unit 204”.

Processing to be performed by each of the units 201 to 207 in thecommunication apparatus 100 illustrated in FIG. 2 is executed by thesub-CPU 106 of the sub-system 103 (FIG. 1). The communication apparatus100 need not necessarily include all the units 201 to 207 describedabove.

The control unit 201 controls the LAN communication control unit 202,the storage control unit 203, the TCP/IP communication control unit 204,the first packet creation unit 205, the second packet creation unit 206,and the first memory free space management unit 207 in the communicationapparatus 100.

The LAN communication control unit 202 controls the communicationinterface 109 (FIG. 1) and also controls LAN communication with anothercommunication apparatus (not illustrated). In a case where thecommunication apparatus 100 is connected to another communicationapparatus via an external wireless access point (not illustrated), theLAN communication control unit 202 controls the communication interface109 to thereby control wireless LAN communication with the wirelessaccess point. The communication method of the LAN communication controlunit 202 is not limited to the communication methods described above.Other communication methods capable of IP communication, such as a wiredLAN communication function, may also be used.

The storage control unit 203 controls the main memory 102 and the localmemory 107, and stores or deletes data such as processing data, an imagecontent, and a video content.

The TCP/IP control unit 204 uses the LAN communication control unit 202to perform communication control using the TCP/IP method with anothercommunication apparatus. While the present exemplary embodimentillustrates an example where TCP/IP communication is used, thecommunication protocol is not limited to this. Other protocols such as aUDP may also be used.

The first packet creation unit 205 creates the communication headers 118by hardware processing using the header processing unit 110 of thesub-system 103, and collectively creates a plurality of transmissionpackets using the communication headers 118. The first packet creationunit 205 is used by the TCP/IP control unit 204.

The second packet creation unit 206 creates transmission packets bysoftware processing. Specifically, the second packet creation unit 206creates communication headers by software processing, and createstransmission packets using the communication headers. The second packetcreation unit 206 does not use the header processing unit 110. Thesecond packet creation unit 206 is used by the TCP/IP control unit 204.

The first memory free space management unit 207 manages a free space 119of the internal memory 113. The first memory free space management unit207 is used by the TCP/1P control unit 204.

(Processing Procedure of Packet Creation Unit)

A processing procedure of the first packet creation unit 205 will now bedescribed. The processing procedure described below is an example of theprocessing procedure performed by the first packet creation unit 205.Other processing procedures may be employed as long as the packetcreation unit 205 creates the communication headers 118 in the internalmemory 113.

The first packet creation unit 205 (main CPU 101) first detects whethertransmission data is stored in the application buffer of the main memory102. The transmission data is data to be transmitted by thecommunication apparatus 100 to another communication apparatus. When itis detected that the transmission data is stored in the applicationbuffer, the first packet creation unit 205 (main CPU 101) notifies thesub-CPU 106 in the sub-system 103 of transmission information, such as adata size, a storage location, and other transmission data. The sub-CPU106 (first packet creation unit 205) which has received the notificationuses the DMA controller 108 to transfer the transmission data from themain memory 102 to the local memory 107 based on the transmissioninformation. Next, the first packet creation unit 205 (sub-CPU 106)divides the transmission data stored in the local memory 107 into unitsof packets and sets a payload portion in each packet. Further, the firstpacket creation unit 205 (sub-CPU 106) sets, as information necessaryfor creating a header, the template header 115, the header editinformation 116, and the control information 117 in the register unit112 of the header processing unit 110. Furthermore, the first packetcreation unit 205 creates the communication headers 118 in the internalmemory 113 through the header processing unit 110 (core unit 114) basedon the information stored in the register unit 112. Lastly, the firstpacket creation unit 205 (sub-CPU 106) combines the communicationheaders 118 in the internal memory 113 with the transmission data in thelocal memory 107 through the DMA controller 108, thereby creatingpackets in the local memory 107.

The sub-CPU 106 transmits the created packets to an external apparatus(another communication apparatus) via the communication interface 109,using the DMA controller 108. While the present exemplary embodimentillustrates an example where packets are created in the local memory107, transmission data may be created in the main memory 102 or anothermemory.

Next, a processing procedure of the second packet creation unit 206 willbe described. The processing procedure described below is an example ofthe processing procedure performed by the second packet creation unit206. Other processing procedures may be employed as long as the packetcreation 206 unit creates the communication headers 118 in the localmemory 107.

The second packet creation unit 206 (main CPU 101) first detects thattransmission data is stored in the application buffer of the main memory102. After the detection, the second packet creation unit 206 (main CPU101) notifies the sub-CPU 106 in the sub-system 103 of the transmissioninformation. The sub-CPU 106 (second packet creation unit 206) which hasreceived the notification uses the DMA controller 108 to transfer thetransmission data from the main memory 102 to the local memory 107 basedon the transmission information. Next, the second packet creation unit206 (sub-CPU 106) divides the transmission data stored in the localmemory 107 into units of packets and sets a payload portion in eachpacket. Further, the second packet creation unit 206 (sub-CPU 106)creates the communication headers 118 in the local memory 107 bysoftware processing, and combines the communication headers 118 with thepayloads, thereby creating packets.

The sub-CPU 106 transmits the created packets to an external apparatusvia the communication interface 109. While the present exemplaryembodiment illustrates an example where packets are created in the localmemory 107, packets may be created in the main memory 102 or anothermemory.

(Packet Transmission Using Packet Creation Units Selectively)

FIG. 3 is a flowchart illustrating a procedure in which thecommunication apparatus 100 according to the present exemplaryembodiment to switches transmission packet creation units. In thefollowing description, a reference symbol “S” denotes a step.

In step S301, the TCP/IP control unit 204 of the communication apparatus100 calculates the total size (header data size) of communicationheaders to be created based on the number of packets that can becollectively created when creating transmission packets. Further, theTCP/IP control unit 204 compares the calculated total size ofcommunication headers with the size of the free space 119 acquired bythe first memory free space management unit 207. Specifically, theTCP/IP control unit 204 determines whether the total size ofcommunication headers to be created is equal to or less than the freespace 119 of the internal memory 113. If the total size of communicationheaders to be created is equal to or less than the size of the freespace 119 acquired by the first memory free space management unit 207(YES in step S301), the processing proceeds to step S302. If the totalsize of communication headers to be created exceeds the size of the freespace 119 acquired by the first memory free space management unit 207(NO in step S301), the processing proceeds to step S303.

In step S302, the TCP/IP control unit 204 instructs the first packetcreation unit 205 to create transmission packets. As described above,the first packet creation unit 205 creates the communication headers 118in the internal memory 113. In other words, in step S302, the TCP/IPcontrol unit 204 orders the first packet creation unit 205 to createcommunication packets by performing hardware processing using theinternal memory 113. In response to the instruction, the first packetcreation unit 205 creates transmission packets.

In step S303, the TCP/IP control unit 204 instructs the second packetcreation unit 206 to create transmission packets. As described above,the second packet creation unit 206 creates the communication headers118 in the local memory 107. In other words, in step S303, the TCP/IPcontrol unit 204 orders the second packet creation unit 206 to createtransmission packets by performing software processing using the localmemory 107. In response to the instruction, the second packet creationunit 206 creates transmission packets.

In step S301, the TCP/IP control unit 204 selects whether to createtransmission packets by performing hardware processing or createtransmission packets by performing software processing, based on thefree space 119 of the internal memory 113 and the data size required forcreating headers in the case of creating transmission packets byhardware processing. If creation of transmission packets by hardwareprocessing is selected (YES in step S301), the internal memory 113 isused to create transmission packets by performing hardware processing.If creation of transmission packets by software processing is selected(NO in step S301), the local memory 107 is used to create transmissionpackets by performing software processing. The data size required forcreating headers may also be referred to as a header size.

It can be said that the case where the determination result of step S301indicates YES corresponds to a case where the free space 119 of theinternal memory 113 is equal to or more than the data size required forcreating headers. It can be said that the case where the determinationresult of step S301 indicates NO corresponds to a case where the freespace 119 of the internal memory 113 is less than the data size requiredfor creating headers.

Advantageous Effects of First Exemplary Embodiment

The communication apparatus 100 according to the first exemplaryembodiment selectively uses the first packet creation unit 205 and thesecond packet creation unit 206 based on the total size of communicationheaders to be created and the size of the free space 119 of the internalmemory 113 in the case of collectively creating a plurality oftransmission packets. Specifically, if the free space 119 of theinternal memory 113 is insufficient (NO in step S301), in step S303, thesecond packet creation unit 206 is used to create transmission packets,without using the first packet creation unit 205 (without waiting forrelease of the internal memory 113). In this manner, using the firstpacket creation unit 205 and the second packet creation unit 206 in aselective manner prevents the processing of the first packet creationunit 205 from being unexecuted due to waiting for release of theinternal memory 113 and also prevents a deterioration in thecommunication performance of the communication apparatus 100.

MODIFIED EXAMPLE

In step S301, the TCP/IP control unit 204 of the communication apparatus100 calculates the total size of communication headers to be createdbased on the number of packets that can be collectively created.Alternatively, the total size of communication headers to be created maybe calculated and acquired from the information held in the registerunit 112.

Next, a communication apparatus 100A according to a second exemplaryembodiment of the present disclosure will be described with reference toFIGS. 1, 4, and 5. In the following description, components, controlsand processing similar to those of the first exemplary embodiment aredenoted by the same reference numerals, and descriptions thereof will bethus omitted.

In the first exemplary embodiment, if the total size of communicationheaders to be created exceeds the size of the free space 119 of theinternal memory 113 (NO in step S301), the second packet creation unit206 is used to create transmission packets. The present disclosure isnot limited to this exemplary embodiment. For example, even when thetotal size of communication headers to be created exceeds the size ofthe free space 119 of the internal memory 113, if a predeterminedcondition is satisfied, the first packet creation unit 205 may be usedto create transmission packets after waiting for release of the internalmemory 113. The communication apparatus 1.001 that performs suchprocessing will be described below as the second exemplary embodiment.

(Configuration of Apparatus)

A module configuration of the communication apparatus 100A according tothe second exemplary embodiment is similar to that of the firstexemplary embodiment (FIG. 1). FIG. 4 illustrates a softwareconfiguration of the communication apparatus 100A according to thesecond exemplary embodiment. The software configuration illustrated inFIG. 4 is a configuration in which a communication interface specifyingunit 208, a memory release time management unit 209, and a packetcreation time calculation unit 210 are added to the softwareconfiguration (first exemplary embodiment) illustrated in FIG. 2.

The communication interface specifying unit 208 specifies thecommunication interface 109 (FIG. 1) used to transmit packets. Forexample, the communication interface specifying unit 208 specifieswhether a communication interface suitable for a wired network is usedor a communication interface suitable for a wireless network is used.The communication interface specifying unit 208 is used by the TCP/IPcontrol unit 204. The communication interface specifying unit 208acquires packet header information and communication interfaceinformation to be used when the LAN communication control unit 202controls the communication interface 109 to transmit packets. Further,the communication interface specifying unit 208 manages the packetheader information and the communication interface 109 in associationwith each other. The TCP/IP control unit 204 sends an inquiry about thecommunication interface to be used to the communication interfacespecifying unit 208 using the header information about the transmissionpackets.

The memory release time management unit 209 manages a time an averagerelease time) required for the internal memory 113 to be released afterthe communication headers 118 are created in the internal memory 113 andpacket transmission is completed. The memory release time managementunit 209 manages the average release time by type (wireless LANcommunication, wired LAN communication, etc.) of the communicationinterface 109 included in the communication apparatus 100A. The memoryrelease time management unit 209 is used by the TCP/IP control unit 204.The average release time of the internal memory 113 held by the memoryrelease time management unit 209 is set (input) in advance. The memoryrelease time management unit 209 may measure a release time of theinternal memory 113 during transmission processing and update theaverage release time.

A period of time (release time) from a time when the communicationheaders 118 are created in the internal memory 113 to a time when thepacket transmission is completed and the internal memory 113 is releasedcan also be referred to as a waiting time for the internal memory 113 tobe released (memory release waiting time).

The packet creation time calculation unit 210 acquires and calculates aprocessing time (e.g., an average processing time) required for creatingpackets in the second packet creation unit 206 that creates thecommunication headers 118 in the local memory 107. The packet creationtime calculation unit 210 is used by the TCP/IP control unit 204. Theaverage processing time per packet that is held by the packet creationtime calculation unit 210 is preliminarily set for each type of thecommunication interface 109. The packet creation time calculation unit210 may measure a packet creation time of the second packet creationunit 206 and update the average processing time per packet.

(Packet Transmission Using Packet Creation Units Selectively)

FIG. 5 is a flowchart illustrating a procedure for the communicationapparatus 100A according to the present exemplary embodiment to switchthe transmission packet creation units.

Step S501 is similar to step S301. Step S502 is similar to step S302. Ifthe determination result of step S501 indicates NO, the processingproceeds to step S503.

In step S503, the TCP/IP control unit 204 of the communication apparatus100A uses the communication interface specifying unit 208 to specify thecommunication interface 109 through which transmission packets aretransmitted. Then, the TCP/IP control unit 204 acquires an averagerelease time (average memory release waiting time) of the specifiedcommunication interface 109 from the memory release time management unit209. In the present exemplary embodiment, the release waiting time ofthe internal memory 113 is determined based on the specifiedcommunication interface 109.

In step S504, the TCP/IP control unit 204 uses the packet creation timecalculation unit 210 to acquire a packet creation time for the secondpacket creation unit 206 to create packets corresponding to the numberof packets to be created. In other words, the TCP/IP control unit 204acquires the packet creation time for creating packets by performingsoftware processing. Further, the TCP/IP control unit 204 compares thepacket creation time in the second packet creation unit 206 with theaverage release time (average memory release waiting time of thecommunication interface) acquired in step S503. Specifically, the TCP/IPcontrol unit 204 determines whether the packet creation time in softwareprocessing is longer than the average memory release waiting time of thecommunication interface. If the packet creation time of the secondpacket creation unit 206 is longer than the average release time (YES instep S504), the processing proceeds to step S505. If the packet creationtime of the second packet creation unit 206 is equal to or less than theaverage release time (NO in step S504), the processing proceeds to stepS506.

In step S505, the TCP/IP control unit 204 waits for release of theinternal memory 113, and then sends an instruction for creatingtransmission packets in the first packet creation unit 205 that createsthe communication headers 118 in the internal memory 113. Specifically,the TCP/IP control unit 204 waits for release of the internal memory 113and instructs the first packet creation unit 205 to create transmissionpackets after the release. In response to the instruction, the firstpacket creation unit 205 creates transmission packets by hardwareprocessing.

Step S506 is similar to step S303.

It can be said that the case where the processing proceeds from stepS501 through step S505 corresponds to a case where the free space 119 ofthe internal memory 113 is less than the header data size and therelease waiting time of the internal memory 113 is less than the packetcreation time of the second packet creation unit 206. Further, the casewhere the processing proceeds from step S501 through step S506corresponds to a case where the free space 119 of the internal memory113 is less than the header data size and the release waiting time ofthe internal memory 113 is equal to or more than the packet creationtime of the second packet creation unit 206.

Advantageous Effects of Second Exemplary Embodiment

The communication apparatus 100A according to the present exemplaryembodiment does not immediately switch the packet creation units evenwhen the total size of communication headers to be created exceeds thesize of the free space 119 of the internal memory 113 in the case ofcollectively creating a plurality of transmission packets. Thecommunication apparatus 100A determines which one of the first packetcreation unit 205 and the second packet creation unit 206 is used tocreate transmission units after waiting for release of the internalmemory 113 based on the average release time set for each communicationinterface 109. This determination enables improvement in the processingefficiency of creating transmission packets and prevents a deteriorationin communication performance, as compared with the case of creatingtransmission packets in the second packet creation unit 206 every timewhen the free space 119 of the internal memory 113 is insufficient. Inother words, in the second exemplary embodiment, even when the freespace 119 of the internal memory 113 is insufficient, if any stagnationof the packet creation processing can be prevented by using the firstpacket creation unit 205 after waiting for release of the internalmemory 113, release of the internal memory 113 is awaited.

MODIFIED EXAMPLE

In step S503, the communication interface 109 through which transmissionpackets are transmitted to another communication apparatus is specifiedand the average memory release waiting time corresponding to thespecified communication interface 109 is acquired. However, theprocessing in step S503 is not limited thereto. Any processing may beperformed in step S503, as long as the release waiting time of theinternal memory 113 corresponding to the communication interface can beacquired (or calculated). For example, the processing of specifying thecommunication interface 109 may be omitted, as long as the releasewaiting time of the internal memory 113 corresponding to thecommunication interface can be acquired or calculated even when theprocessing of specifying the communication interface 109 is omitted.

Next, a communication apparatus 100B according to a third exemplaryembodiment of the present disclosure will be described with reference toFIGS. 1, 6, and 7. In the following description, components, controlsand processing similar to those of the first exemplary embodiment aredenoted by the same reference numerals, and descriptions thereof will beomitted.

In the first exemplary embodiment, in the first step (S301) of theflowchart (FIG. 3) for switching the transmission packet creation units,it is only determined whether the total size of communication headers tobe created is equal to or less than the size of the free space 119 ofthe internal memory 113. The present disclosure is not limited to thisexemplary embodiment. For example, the first packet creation unit 205and the second packet creation unit 206 may be selectively used inconsideration of the number of transmission packets and headerinformation (a flag, a protocol type, etc.). The communication apparatus100B that performs such processing will be described below as the thirdexemplary embodiment.

(Configuration of Apparatus)

A module configuration of the communication apparatus 100B according tothe present exemplary embodiment similar o that of the first exemplaryembodiment (FIG. 1). FIG. 6 illustrates a software configuration of thecommunication apparatus 100B according to the present exemplaryembodiment. The software configuration of FIG. 6 is a configuration inwhich a packet type determination unit 211 is added to the softwareconfiguration (first exemplary embodiment) illustrated in FIG. 2.

In the present exemplary embodiment, the number of transmission packetsand header information (a flag, a protocol type, etc.) are collectivelyreferred to as the type of a transmission packet. Accordingly, thepacket type determination unit 211 determines the number of transmissionpackets and header information. The packet type determination unit 211is used by the TCP/IP control unit 204.

(Packet Transmission Selectively Using Packet Creation Units)

FIG. 7 is a flowchart illustrating a procedure for the communicationapparatus 100B according to the third exemplary embodiment to switch thetransmission packet creation units.

In step S701, in the case of creating transmission packets, the TCP/IPcontrol unit 204 of the communication apparatus 100B uses the packettype determination unit 211 to determine the type of each transmissionpacket, in addition to the condition of step S301. Specifically, thepacket type determination unit 211 confirms (determines) the number oftransmission packets and a retransmission flag, in addition to thecondition of step S301. If the condition of step S301 is satisfied andthe number of transmission packets is two or more (YES in step S701),the processing proceeds to step S702. If the condition of step S301 issatisfied and the retransmission flag cannot be confirmed (YES in stepS701), the processing proceeds to step S702. If the transmission packetsinclude no retransmission packet (or if the transmission packets are notretransmission packets), the retransmission flag cannot be confirmed.

On the other hand, if the condition of step S301 is satisfied but thenumber of transmission packets is one (NO in step S701), the processingproceeds to step S703. Even when the condition of step S301 issatisfied, if the retransmission flag is present (or if theretransmission packet is included) (NO in step S701), the processingproceeds to step S703.

The case where the processing proceeds to step S703 from step S701corresponds to, for example, a case where the number of transmissionpackets is one even when the header data size is equal to or less thanthe free space of the internal memory 113.

Since the template header 115 is created by software processing, if thenumber of transmission packets is one, the load of the transmissionpacket creation processing can be reduced when the second packetcreation unit 206 creates the communication headers 118 in the localmemory 107. In other words, if the number of transmission packets isone, the load of the transmission packet creation processing can bereduced when the second packet creation unit 206 creates thecommunication headers 118 in the local memory 107, as compared with thecase where the first packet creation unit 205 creates the communicationheaders 118 in the internal memory 113.

Further, when the transmission packets include retransmission packets,there is a need to create the template header 115 for the retransmissionpacket. Therefore, when the second packet creation unit 206 creates thecommunication headers 118 in the local memory 107, the load of thetransmission packet creation processing can be reduced. In other words,also in this case, the load of the transmission packet creationprocessing can be reduced when the second packet creation unit 206creates the communication headers 118 in the local memory 107, ascompared with the case where the first packet creation unit 205 createsthe communication headers 118 in the internal memory 113.

Step S702 is similar to step S302. Step S703 is similar to step S303.

Advantageous Effects of Third Exemplary Embodiment

In the case of collectively creating a plurality of transmissionpackets, the communication apparatus 100B according to the presentexemplary embodiment selectively uses the first packet creation unit 205and the second packet creation unit 206 based on the total size ofcommunication headers to be created and the type (the number oftransmission packets, and a retransmission flag) of each transmissionpacket. Consequently, the efficiency of the transmission packet creationprocessing can be improved and a deterioration in communicationperformance can be suppressed or prevented as compared with the firstexemplary embodiment. In other words, the efficiency of the transmissionpacket creation processing can be improved and a deterioration incommunication performance can be suppressed or prevented as comparedwith the case where the first packet creation unit 205 createstransmission packets (the processing proceeds from step S301 to stepS302) every time when the internal memory 113 can be used.

MODIFIED EXAMPLE

In step S701, in the case where the condition of S301 is satisfied, aslong as the retransmission flag is absent, the determination result ofstep S701 indicates YES even if the number of transmission packets isnot two or more. In step S701, in the case where the condition of stepS301 is satisfied, as long as the retransmission flag is absent, thedetermination result of step S701 indicates YES even if the number oftransmission packets is two or more. The processing in step S701according to the present exemplary embodiment is not limited to suchprocessing. For example, the determination result of step S701 mayindicate YES when the condition of step S301 is satisfied as well asonly when the number of transmission packets is two or more and theretransmission flag is absent. In the third exemplary embodiment, one ormore conditions are added to the determination condition of step S301,and which one of the first packet creation unit 205 and the secondpacket creation unit 206 is to be used is determined (selected) based onthe determination result. Making a determination using the additionalcondition(s) in step S701 enables a further improvement in theefficiency of the transmission packet creation processing.

In step S701, the determination may be made based on the protocol type.

Next, a communication apparatus 100C according to a fourth exemplaryembodiment of the present disclosure will be described with reference toFIGS. 1, 2, and 8. In the following description, components, controlsand processing similar to those of the first exemplary embodiment aredenoted by the same reference numerals, and descriptions thereof will beomitted.

In the first exemplary embodiment, the first packet creation unit 205and the second packet creation unit 206 are selectively used based onwhether the total size of communication headers to be created is equalto or less than the size of the free space 119 of the internal memory113. The present disclosure is not limited to this exemplary embodiment.For example, the first packet creation unit 205 and the second packetcreation unit 206 may be selectively used based on whether the freespace 119 of the internal memory 113 is equal to or more than the headersize per packet. The communication apparatus 100C that performs suchprocessing will be described below as the fourth exemplary embodiment.

(Configuration of Apparatus)

A module configuration of the communication apparatus 100C according tothe fourth exemplary embodiment is similar to that of the firstexemplary embodiment (FIG. 1). A software configuration of thecommunication apparatus 100C according to the fourth exemplaryembodiment is a configuration in which a transmission data sizedetermination unit is added to the software configuration (firstexemplary embodiment) illustrated in FIG. 2. It can also be said thatthis software configuration is a configuration in which the packet typedetermination unit 211 in the software configuration (third exemplaryembodiment) illustrated in FIG. 6 is replaced by the transmission datasize determination unit.

The transmission data size determination unit compares the free space119 of the internal memory 113 with the header size per packet. Further,the transmission data size determination unit determines a size of datato be extracted from the application buffer based on the pieces ofcommunication header information of packets received from anothercommunication apparatus, the free space of a memory, or the like. Thetransmission data size determination unit is used by the TCP/IP controlunit 204. (Packet Transmission Selectively Using Packet Creation Units)

FIG. 8 is a flowchart illustrating a procedure for the communicationapparatus 100C according to the fourth exemplary embodiment to switchthe transmission packet creation units.

In step S801, in the case of creating transmission packets, the TCP/IPcontrol unit 204 of the communication apparatus 100C uses thetransmission data size determination unit to compare the free space 119of the internal memory 113 with the header size per packet.Specifically, the TCP/IP control unit 204 determines whether the freespace 119 of the internal memory 113 is equal to or more than the headersize per packet. If the free space 119 of the internal memory 113 isequal to or more than the header size per packet (YES in step S801), theprocessing proceeds to step S802. If the free space 119 of the internalmemory 113 is less than the header size per packet (NO in step S801),the processing proceeds to step S804. In the flowchart of FIG. 8, theheader size per packet is used as the size to be compared with the freespace 119 of the internal memory 113, but instead the total of headersizes of a plurality of packets may be used.

If the determination result of step S801 indicates YES, the TCP/IPcontrol unit 204 determines that the internal memory 113 can be used. Inthe first exemplary embodiment, it is determined that the internalmemory 113 can be used when the free space 119 of the internal memory113 is equal to or more than the total size of communication headers.However, in the present exemplary embodiment, it is determined that theinternal memory 113 can be used when the free space 119 is equal to ormore than the header size per packet. If the determination result ofstep S801 indicates NO, the TCP/IP control unit 204 determines that theinternal memory 113 cannot be used.

In step S802, the TCP/1P control unit 204 calculates the number ofheaders that can be stored in the free space 119 of the internal memory113 so that the first packet creation unit 205 creates transmissionpackets using the internal memory 113. To calculate the number ofheaders, the TCP/IP control unit 204 uses the transmission data sizedetermination unit. Further, the TCP/IP control unit 204 causes thetransmission data size determination unit to determine a size of data tobe extracted from a transmission buffer based on the size of data thatcan be transmitted by a number of packets corresponding to the number ofheaders. Specifically, in step S802, the transmission data sizedetermination unit determines a size of data to be extracted from thetransmission buffer based on the free space 119 of the internal memory113.

Although the processing in step S803 is similar to that in step S302,the first packet creation unit 205 creates transmission packets based onthe data size determined in step S802. In other words, the number oftransmission packets to be created is determined by the data sizedetermined in step S802.

In a case where the processing proceeds to step S804 from step S801, theTCP/IP control unit 204 has determined that the internal memory 113cannot be used, and thus the second packet creation unit 206 createstransmission packets. In step S804, the TCP/IP control unit 204determines a size of data to be extracted from the transmission bufferbased on the pieces of communication header information about packetsreceived from another communication apparatus so that the second packetcreation unit 206 creates transmission packets. The communication headerinformation about a packet received from another communication apparatusincludes, for example, a window size. To determine a size of data to beextracted from the transmission buffer, the TCP/IP control unit 204 usesthe transmission data size determination unit.

Although the processing in step S805 is similar to that in step S303,the second packet creation unit 206 creates transmission packets basedon the data size determined in step S804. In other words, the number oftransmission packets to be created is determined by the data sizedetermined in step S804.

Fourth Exemplary Embodiment

To collectively create a plurality of transmission packets, thecommunication apparatus 1000 first determines whether the free space 119of the internal memory 113 is equal to or more than the header size perpacket (S801). If the free space 119 of the internal memory 113 is equalto or more than the header size per packet, the communication apparatus1000 determines that the internal memory 113 can be used, and thus thefirst packet creation unit 205 creates transmission packets. Further,the communication apparatus 1000 determines a size of data to beextracted from the transmission buffer based on the free space 119 ofthe internal memory 113, and then creates transmission packets. In thepresent exemplary embodiment, such processing enables the first packetcreation unit 205 to create transmission packets until the internalmemory 113 is used up, which leads to an improvement in communicationperformance.

Also in the present exemplary embodiment, if the free space 119 of theinternal memory 113 is insufficient (NO in step S801), the second packetcreation unit 206 is used to create transmission packets, without usingthe first packet creation unit 205 (without waiting for release of theinternal memory 113) (steps S804 and S805). Consequently, it is possibleto prevent the processing of the first packet creation unit 205 frombeing unexecuted due to waiting for release of the internal memory 113and also prevent a deterioration in the communication performance of thecommunication apparatus 100C.

Next, a communication apparatus 100D according to a fifth exemplaryembodiment of the present disclosure will be described with reference toFIGS. 1, 2, and 9. In the following description, components, controlsand processing similar to those of the first exemplary embodiment aredenoted by the same reference numerals, and descriptions thereof will beomitted.

In the first exemplary embodiment, if the total size of communicationheaders to be created is larger than the size of the free space 119 ofthe internal memory 113, the second packet creation unit 206 isconstantly used (the processing proceeds from step S301 to step S303).The present disclosure is not limited to this exemplary embodiment Forexample, if the total size of communication headers to be created islarger than the size of the free space 119 of the internal memory 113,it is determined whether the free space of the local memory 107satisfies a predetermined condition. If the free space of the localmemory 107 satisfies the predetermined condition, the second packetcreation unit 206 is used. If the free space of the local memory 107does not satisfy the predetermined condition, there is no need to usethe second packet creation unit 206. The communication apparatus 100Dthat performs such processing will be described below as the fifthexemplary embodiment.

In the fifth exemplary embodiment, if the free space of the local memory107 does not satisfy the predetermined condition, the communicationapparatus 100D confirms whether there is another available memory, andif there is another available memory, the communication apparatus 100Duses the memory to create transmission packets. If there is no otheravailable memory, the communication apparatus 100D waits for release ofthe internal memory 113 or the local memory 107, and the first packetcreation unit 205 or the second packet creation unit 206 is used tocreate transmission packets.

(Configuration of Apparatus)

A module configuration example of the communication apparatus 100Daccording to the fifth exemplary embodiment is similar to that of thefirst exemplary embodiment (FIG. 1). An example of a softwareconfiguration of the communication apparatus 100D according to the fifthexemplary embodiment is a configuration in which a second memory freespace management unit is added to the software configuration (firstexemplary embodiment) illustrated in FIG. 2. It can also be said thatthis software configuration is a configuration in which the packet typedetermination unit 211 in the software configuration (third exemplaryembodiment) illustrated in FIG. 6 is replaced by the second memory freespace management unit.

The second memory free space management unit manages the free space ofthe local memory 107. The second memory free space management unit isused by the TCP/IP control unit 204.

(Packet Transmission Selectively Using Packet Creation Units)

FIG. 9 is a flowchart illustrating a procedure for the communicationapparatus 100D according to the present exemplary embodiment to switchthe transmission packet creation units.

The processing in step S901 is similar to that in step S301. Theprocessing in step S902 is similar to that in step S302. If thedetermination result of step S901 indicates NO, the processing proceedsto step S903.

In step S903, to create transmission packets, the TCP/IP control unit204 of the communication apparatus 100D uses the second memory freespace management unit and compares the free space of the local memory107 with the header size per packet. Specifically, the TCP/IP controlunit 204 determines whether the free space of the local memory 107 isequal to or more than the header size per packet. If the free space ofthe local memory 107 is equal to or more than the header size per packet(YES in step S903), the processing proceeds to step S904. If the freespace of the local memory 107 is less than the header size per packet(NO in step S903), the processing proceeds to step S905. The case wherethe processing proceeds to step S905 from step S901 via step S903corresponds to a case where the internal memory 113 and the local memory107 do not have a sufficient free space. In this case, the TCP/IPcontrol unit 204 determines that the internal memory 113 and the localmemory 107 cannot be used to create transmission packets. Step S904 issimilar to step S303.

In step S905, the TCP/IP control unit 204 determines whether a memory(referred to as “another memory” in FIG. 9) that can be used to createtransmission packets is present except the internal memory 113 and thelocal memory 107. If another memory that can be used to createtransmission packets is present (YES in step S905), the processingproceeds to step S906. If another memory that can be used to createtransmission packets is not present (NO in step S905), the processingproceeds to step S907.

In step S906, the TCP/IP control unit 204 uses another memory other thanthe internal memory 113 and the local memory 107, and createstransmission packets by software processing. The transmission packetcreation unit used in this case may be the second packet creation unit206 using another memory instead of the local memory 107, or may beanother unit.

In step S907, the TCP/IP control unit 204 waits for release of theinternal memory 113 or the local memory 107 through the first memoryfree space management unit 207 and the second memory free spacemanagement unit. When the internal memory 113 is released, the TCP/IPcontrol unit 204 causes the first packet creation unit 205 to createtransmission packets. When the local memory 107 is released, the TCP/IPcontrol unit 204 causes the second packet creation unit 206 to createtransmission packets.

Advantageous Effects of Fifth Exemplary Embodiment

The communication apparatus 100D according to the fifth exemplaryembodiment has advantageous effects similar to those of the firstexemplary embodiment. Specifically, in the case of collectively creatinga plurality of transmission packets, if the free space 119 of theinternal memory 113 is insufficient (NO in step S901), the first packetcreation unit 205 is not used (i.e., release of the internal memory 113is not awaited). If the local memory 107 has a sufficient free space(YES in step S903), the second packet creation unit 206 is used tocreate transmission packets (step S904). Consequently, it is possible toprevent the processing of the first packet creation unit 205 from beingunexecuted due to waiting for release of the internal memory 113 andalso prevent a deterioration in the communication performance of thecommunication apparatus 100D.

In the case of collectively creating a plurality of transmissionpackets, if the internal memory 113 and the local memory 107 do not havea sufficient free space, the communication apparatus 100D confirms(determines) whether another available memory is present. If anotheravailable memory is present, the memory is used to create transmissionpackets. If there is no other available memory, the communicationapparatus 100D waits for release of the internal memory 113 or the localmemory 107. This processing prevents a deterioration in communicationperformance even when both the internal memory 113 and the local memory107 have no sufficient free space.

MODIFIED EXAMPLE

In the flowchart illustrated in FIG. 9, the processing proceeds to stepS906 or S907 after the determination of step S905. However, in a casewhere it has been already confirmed that another memory is present andthe determination result of step S903 indicates NO, the processing mayproceed to step S906 without passing through step S905.

In step S903, the header size per packet is compared with the free spaceof the local memory 107, but instead the header size of a predeterminednumber of (a plurality of) packets may be compared with the free spaceof the local memory 107.

Other Exemplary Embodiments

The communication apparatuses 100 to 100D are described in the aboveexemplary embodiments. However, the present disclosure can also beembodied (implemented) in other modes. For example, the presentdisclosure can also be implemented in such a manner that a program(computer program) for implementing one or more functions according tothe exemplary embodiments described above is supplied to a system orapparatus via a network or recording medium (storage medium), and one ormore processors in a computer of the system or apparatus load andexecute the program. In this case, the program (program code) read fromthe recording medium implements the functions according to the exemplaryembodiments. Further, the recording medium recording the program canconstitute the present disclosure.

While the functions according to the exemplary embodiments can beimplemented by executing the program loaded into the computer, thefunctions according to the exemplary embodiments described above mayalso be implemented by processing in which an operating system (OS)running on the computer performs a part or the whole of the actualprocessing based on an instruction from the program.

The communication apparatuses 100 to 100D may also include an operationunit and a display unit. For example, the operation unit receives anoperation or input from a user. The operation unit includes, forexample, a keyboard and a touch panel. The display unit has a functionfor outputting at least one of a visual display and audio. The displayunit includes, for example, a liquid crystal panel, a light-emittingdiode (LED), and a speaker, and performs various displays and audiooutput under control of the main CPU 101.

In the exemplary embodiments described above, the wireless communicationwith another communication apparatus is controlled by the LANcommunication control unit 202 illustrated in FIGS. 2, 4, and 6.However, if communication with another communication apparatus isperformed using a communication method other than the wireless LAN, acommunication control unit that replaces the LAN communication controlunit 202 is used. The communication with another communication apparatusmay be wireless communication or wired communication.

Any apparatus can be used as each of the communication apparatuses 100to 100D, as long as the apparatus includes a communication function anda function for creating communication headers by hardware or software.Examples of the apparatus includes a personal computer, a tabletcomputer, a smartphone, a camera, and a projector. The header processingunit 110 may be configured as a processor.

The software configurations illustrated in FIGS. 2, 4, and 6 are merelyexamples. The plurality of blocks may constitute one block, or some ofthe blocks may be divided into blocks for performing a plurality offunctions.

At least some of the blocks illustrated in FIGS. 2, 4, and 6 may beimplemented by hardware. In the case where some blocks are implementedby hardware, for example, a dedicated circuit may be automaticallycreated on a Field-Programmable Gate Array (FPGA) from a program forimplementing each step, using a predetermined compiler. Further, similarto the FPGA, a gate array circuit may be formed to implement the blocksby hardware. Furthermore, the blocks may be implemented by anApplication Specific Integrated Circuit (ASIC).

According to the present disclosure, it is possible to efficientlycreate transmission packets even when the free space of a storage unitfor storing headers of transmission packets is insufficient.

Other Embodiments

Embodiment(s) of the present disclosure can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (MID), or Blu-ray Disc (BD)™)a flash memory device, a memory card, and the like.

While the present disclosure has been described with reference toexemplary embodiments, the scope of the following claims are to beaccorded the broadest interpretation so as to encompass all suchmodifications and equivalent structures and functions.

This application claims the benefit of Japanese Patent Application No.2017-180037, filed Sep. 20, 2017, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. A communication apparatus comprising: a firststorage unit configured to store a header of a transmission packet whenthe transmission packet is created in a first processing procedure; afirst creation unit configured to create the transmission packet in thefirst processing procedure using the first storage unit; a secondstorage unit configured to store the header of the transmission packetwhen the transmission packet is created in a second processing proceduredifferent from the first processing procedure; a second creation unitconfigured to create the transmission packet in the second processingprocedure using the second storage unit; and a control unit configuredto perform control to determine which one of the first creation unit andthe second creation unit is used based on a data size for the firstcreation unit to create the header and a free space of the first storageunit.
 2. The communication apparatus according to claim 1, furthercomprising a processor configured to create the header of thetransmission packet, wherein the first storage unit is an internalmemory of the processor.
 3. The communication apparatus according toclaim 2, wherein in the first processing procedure, the header of thetransmission packet is created by hardware processing using theprocessor, and wherein in the second processing procedure, the header ofthe transmission packet is created by software processing.
 4. Thecommunication apparatus according to claim 1, wherein in a case wherethe free space of the first storage unit is equal to or more than thedata size, the control unit controls the first creation unit to createthe transmission packet, and in a case where the free space of the firststorage unit is less than the data size, the control unit controls thesecond creation unit to create the transmission packet.
 5. Thecommunication apparatus according to claim 1, wherein in a case wherethe free space of the first storage unit is less than the data size anda release waiting time of the first storage unit is less than a packetcreation time of the second creation unit, the control unit waits forrelease of the first storage unit and controls the first creation unitto create the transmission packet.
 6. The communication apparatusaccording to claim 5, further comprising a specifying unit configured tospecify a communication interface through which the transmission packetis transmitted to another communication apparatus, wherein the releasewaiting time of the first storage unit is a time determined based on thecommunication interface specified by the specifying unit.
 7. Thecommunication apparatus according to claim 1, wherein in a case wherethe free space of the first storage unit is less than the data size anda release waiting time of the first storage unit is equal to or morethan a packet creation time of the second creation unit, the controlunit controls the second creation unit to create the transmissionpacket.
 8. The communication apparatus according to claim 1, whereineven when the data size is equal to or less than the free space of thefirst storage unit, the control unit controls the second creation unitto create the transmission packet in a case where a number of thetransmission packets is
 1. 9. The communication apparatus according toclaim 1, wherein even when the data size is equal to or less than thefree space of the first storage unit, the control unit controls thesecond creation unit to create the transmission packet in a case wherethe transmission packet is a retransmission packet.
 10. Thecommunication apparatus according if claim 1, wherein in a case wherethe data size is equal to or less than the free space of the firststorage unit and a number of the transmission packets is two or more,the control unit controls the first creation unit to create thetransmission packet.
 11. The communication apparatus according to claim1, wherein in a case where the data size is equal to or less than thefree space of the first storage unit and the transmission packet is nota retransmission packet, the control unit controls the first creationunit to create the transmission packet.
 12. The communication apparatusaccording to claim 1, wherein in a case where the free space of thefirst storage unit is equal to or more than a header size of apredetermined number of packets, the control unit controls the firstcreation unit to create the transmission packet based on the free spaceof the first storage unit.
 13. The communication apparatus according toclaim 1, wherein in a case where the free space of the first storageunit is less than a header size of a predetermined number of packets,the control unit controls the second creation unit to create thetransmission packet based on information externally acquired.
 14. Thecommunication apparatus according to claim 1, wherein in a case wherethe free space of the first storage unit is less than the data size andthe free space of the second storage unit is less than a header size ofa predetermined number of packets, the control unit uses a third storageunit to create the transmission packet by software processing, withoutusing the second storage unit.
 15. The communication apparatus accordingto claim 14, wherein in a case where the third storage unit is notpresent, the control unit waits for release of one of the first storageunit and the second storage unit, and. wherein the control unit controlsthe first creation unit to create the transmission packet when the firststorage unit is released, and controls the second creation unit tocreate the transmission packet when the second storage unit is released.16. A control method for a communication apparatus, the communicationapparatus comprising: a first storage unit configured to store a headerof a transmission packet when the transmission packet is created in afirst processing procedure; and a second storage unit configured tostore the header of the transmission packet when the transmission packetis created in a second processing procedure different from the firstprocessing procedure, the control method comprising: selecting whetherto create the transmission packet in the first processing procedure orcreate the transmission packet in the second processing procedure, basedon a free space of the first storage unit and a data size required forcreating the header in a case where the transmission packet is createdin the first processing procedure; controlling, in a case where creatingthe transmission packet in the first processing procedure is selected,the first storage unit to create the transmission packet in the firstprocessing procedure; and controlling, in a case where creating thetransmission packet in the second processing procedure is selected, thesecond storage unit to create the transmission packet in the secondprocessing procedure.
 17. A non-transitory computer-readable storagemedium storing a computer program for causing a computer to execute acontrol method for a communication apparatus, the communicationapparatus comprising: a first storage unit configured to store a headerof a transmission packet when the transmission packet is created in afirst processing procedure; and a second storage unit configured tostore the header of the transmission packet when the transmission packetis created in a second processing procedure different from the firstprocessing procedure, the control method comprising: selecting whetherto create the transmission packet in the first processing procedurecreate the transmission packet in the second processing procedure, basedon a free space of the first storage unit and a data size required forcreating the header in a case where the transmission packet is createdin the first processing procedure; controlling, in a case where creatingthe transmission packet in the first processing procedure is selected,the first storage unit to create the transmission packet in the firstprocessing procedure; and controlling, in a case where creating thetransmission packet in the second processing procedure is selected, thesecond storage unit to create the transmission packet in the secondprocessing procedure.